import React, { Component } from "react";
import { connect } from "react-redux";
class childredux extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    let { numbera } = this.props;
    return <div>我是child{this.props.numbera}---{numbera}</div>;
  }
}
// 将数据插入 state中 data 初始化数据 props一样 vuex 的computed一样
const mapStateToProps = (state) => {
  return {
    // number: state.number //单个数据
    numbera: state.a.number, //多个数据
  };
};
export default connect(mapStateToProps)(childredux);
